#include "StdAfx.h"
#include "ImageProcStep.h"
#include "ProcParamDefDouble.h"
#include "ProcParamDouble.h"
#include "ImageProcFn.h"
#include "DummyTwo.h"


const char * const DummyTwo::FunctionNameDummyTwo = "CalcAvContrast";

DummyTwo::DummyTwo(void) 
{
	_fnApi.SetFunctionName(DummyTwo::FunctionNameDummyTwo);
	_fnApi.SetFunctionDescription("this is another dummy function with one i/p param and one o/p param");
									//inputs
	_fnApi.AddParamDef(new ProcParamDefDouble(0, "contrast", "sets contrast of image in range 0 to 100", ProcParamDef::input, 0.0, 100.0 ));
									//outputs
	_fnApi.AddParamDef(new ProcParamDefDouble(0, ProcParam::attribOutputParamNameResult, "process simply copies input value to output value", ProcParamDef::output, 0.0, 100.0));

	_fnApi.Validate();
}


DummyTwo::~DummyTwo(void)
{
}

bool		DummyTwo::Process(ImageProcStep *step, bool DebugMode)
{
	bool rc = false;
	if ((step != '\0') && (step->IsValid()))
	{
		ProcParamDouble *input = dynamic_cast<ProcParamDouble *>(step->GetInputs()->GetParam(0));
		ProcParamDouble *output = dynamic_cast<ProcParamDouble *>(step->GetOutputs()->GetParam(0));
		if ((input != '\0') && (output != '\0'))
		{
			output->SetValue(input->GetValue());
			rc = true;
		}
	}
	return rc;
}





